//
//  findDetailTableViewCell.m
//  A Learning Walk
//
//  Created by 张勇 on 16/6/15.
//  Copyright © 2016年 战斗民族. All rights reserved.
//

#import "findDetailTableViewCell.h"

@implementation findDetailTableViewCell



- (void)awakeFromNib {
    [super awakeFromNib];

    // Initialization code
}

-(void)setModel:(DetailListModel *)model{
    if (_model != model) {
        [_model release];
    }
    _model = [model retain];

    
    [self.bigImage sd_setImageWithURL:[NSURL URLWithString:_model.coverSmall] placeholderImage:[UIImage imageNamed:@"holderr"]];
    self.bigImage.layer.masksToBounds = YES;
    self.bigImage.layer.cornerRadius = self.bigImage.frame.size.width / 2;
    
    self.titleLabel.text = _model.title;
    self.titleLabel.numberOfLines = 0;
    self.titleLabel.backgroundColor = [UIColor clearColor];
    self.titleLabel.font = [UIFont systemFontOfSize:14];
    
    
    self.iconImageOne.image = [UIImage imageNamed:@"bofang"];
    self.iconImageTwo.image= [UIImage imageNamed:@"shijian"];
    self.iconImageThree.image = [UIImage imageNamed:@"xiaoxi"];
    self.iconImageThree.backgroundColor = [UIColor clearColor];
    self.iconImageTwo.backgroundColor = [UIColor clearColor];
    self.iconImageOne.backgroundColor = [UIColor clearColor];
    
    self.labelOne.font = [UIFont systemFontOfSize:10];
    self.labelOne.textColor = [UIColor grayColor];
 
    self.labelOne.backgroundColor = [UIColor clearColor];
    if (_model.playtimes.integerValue / 10000 >= 1) {
        self.labelOne.text = [NSString stringWithFormat:@"%ld.%ld万",_model.playtimes.integerValue / 10000,_model.playtimes.integerValue % 10000 / 1000];
    }else{
        self.labelOne.text = [NSString stringWithFormat:@"%ld",_model.playtimes.integerValue % 10000];
    
    }
    
    self.labelTwo.font = [UIFont systemFontOfSize:10];
    self.labelTwo.textColor = [UIColor grayColor];
    
    self.labelTwo.backgroundColor = [UIColor clearColor];
    if (_model.duration.integerValue % 60 >= 10) {
        self.labelTwo.text = [NSString stringWithFormat:@"%ld:%ld",_model.duration.integerValue / 60 , _model.duration.integerValue % 60];
    }else{
    
    self.labelTwo.text = [NSString stringWithFormat:@"%ld:%ld",_model.duration.integerValue / 60 , _model.duration.integerValue % 60 * 10];
    }
    
    self.labelThree.font = [UIFont systemFontOfSize:10];
    self.labelThree.textColor = [UIColor grayColor];
   
    self.labelThree.backgroundColor = [UIColor clearColor];
    self.labelThree.text = _model.comments;

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)dealloc {
    [_bigImage release];
    [_titleLabel release];
    [_iconImageOne release];
    [_labelOne release];
    [_iconImageTwo release];
    [_labelTwo release];
    [_iconImageThree release];
    [_labelThree release];
    [_model release];
    [super dealloc];
}
@end
